package com.rongc.client.freight.business.carrier.model;

import com.google.gson.annotations.SerializedName;
import com.rongc.client.core.utils.StringUtils;

import java.io.Serializable;

/**
 * Created by Bruce on 2017/7/7.
 */
public class ConveyanceBean implements Serializable{

    @SerializedName(value = "startPlace",alternate = {"startplace"})
//    @SerializedName("startPlace")
    String startPlace; //
    @SerializedName(value = "endPlace",alternate = {"endplace"})
//    @SerializedName("endPlace")
    String endPlace; //
    @SerializedName(value = "startLat",alternate = {"start_lat"})
//    @SerializedName("startLat")
    String startLat; //
    @SerializedName(value = "endLat",alternate = {"end_lat"})
//    @SerializedName("endLat")
    String endLat; //
    @SerializedName(value = "startLon",alternate = {"start_lon"})
//    @SerializedName("startLon")
    String startLon; //
    @SerializedName(value = "endLon",alternate = {"end_lon"})
//    @SerializedName("endLon")
    String endLon; //
    @SerializedName(value = "carModels",alternate = {"model","carModel"})
//    @SerializedName("carModels")
    String carModels; //
    @SerializedName(value = "carLength",alternate = {"length"})
//    @SerializedName("carLength")
    String carLength; //
    @SerializedName(value = "carLoad",alternate = {"weights","carload"})
//    @SerializedName("carLoad")
    String carLoad; //
    @SerializedName("dulk")
    String dulk; //
    @SerializedName(value = "distance",alternate = {"juli"})
//    @SerializedName("distance")
    String distance; //
    @SerializedName(value = "trucksId",alternate = {"trucks_id"})
//    @SerializedName("trucksId")
    String trucksId;  // 车辆id
    @SerializedName("id")
    String id;  // 车源id
    @SerializedName(value = "image",alternate = {"profile","img"})
//    @SerializedName("image")
    String image; // 用户头像
    @SerializedName(value = "loadTime",alternate = {"loadtime"})
//    @SerializedName("loadTime")
    String loadTime; // 装货时间
    @SerializedName(value = "phone",alternate = {"mobile"})
    String phone; // 司机电话
    @SerializedName("nick")
    String nick; // 司机姓名
    @SerializedName("message")
    String message; // 留言

    @SerializedName("start_ssq")
    String start_ssq; //
    @SerializedName("end_ssq")
    String end_ssq; //


    public String getDistance() {
        return StringUtils.makeDistance(StringUtils.parseDouble(distance));
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getLoadTime() {
        return loadTime;
    }

    public void setLoadTime(String loadTime) {
        this.loadTime = loadTime;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getStartPlace() {
        if(StringUtils.isEmpty(startPlace)) return getStart_ssq();
        return startPlace;
    }

    public void setStartPlace(String startPlace) {
        this.startPlace = startPlace;
    }

    public String getEndPlace() {
        if(StringUtils.isEmpty(endPlace)) return getEnd_ssq();
        return endPlace;
    }

    public void setEndPlace(String endPlace) {
        this.endPlace = endPlace;
    }

    public String getStartLat() {
        return startLat;
    }

    public void setStartLat(String startLat) {
        this.startLat = startLat;
    }

    public String getEndLat() {
        return endLat;
    }

    public void setEndLat(String endLat) {
        this.endLat = endLat;
    }

    public String getStartLon() {
        return startLon;
    }

    public void setStartLon(String startLon) {
        this.startLon = startLon;
    }

    public String getEndLon() {
        return endLon;
    }

    public void setEndLon(String endLon) {
        this.endLon = endLon;
    }

    public String getCarModels() {
        return carModels;
    }

    public void setCarModels(String carModels) {
        this.carModels = carModels;
    }

    public String getCarLength() {
        return carLength;
    }

    public void setCarLength(String carLength) {
        this.carLength = carLength;
    }

    public String getCarLoad() {
        return StringUtils.parseInt(carLoad)+"";
    }

    public void setCarLoad(String carLoad) {
        this.carLoad = carLoad;
    }

    public String getTrucksId() {
        return trucksId;
    }

    public void setTrucksId(String trucksId) {
        this.trucksId = trucksId;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getStart_ssq() {
        return start_ssq;
    }

    public void setStart_ssq(String start_ssq) {
        this.start_ssq = start_ssq;
    }

    public String getEnd_ssq() {
        return end_ssq;
    }

    public void setEnd_ssq(String end_ssq) {
        this.end_ssq = end_ssq;
    }

    public String getDulk() {
        return dulk;
    }

    public void setDulk(String dulk) {
        this.dulk = dulk;
    }
}
